{include file="public/header"}
<link href="__PUBLIC__/css/core.css" type="text/css" rel="stylesheet"/>
<script type="text/javascript" src="__PUBLIC__/js/jquery-1.6.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/lhgdialog/lhgdialog.min.js"></script>
<script src="__PUBLIC__/js/popup_layer.js" type="text/javascript" language="javascript"></script>
<script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
<link href="__PUBLIC__/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript"> 
 /** 
* 加数类
* @param {String} textBoxId 文本框ID 
*/ 
function clsAddNum(textBoxId,tag) 
{ 
	var step = 1; //默认步长 
	/** 
	* 设置值私有方法 
	*/ 
	var textValue = parseInt(document.getElementById(textBoxId).value); 
	
	switch(tag)
	{
		case '+':
			if(textValue==10) return ;
			document.getElementById(textBoxId).value = textValue + step; 
			break;
		case '-':
			if(textValue==0) return ;
			document.getElementById(textBoxId).value = textValue -  step; 
			break;
	}
} 



function opdg( id )
{
    //var dg = new J.dialog({ id:id, html:'lhgdialog' });
    //如果作为jQ组件来用的话J就得换成$
    var dg = new $.dialog({ 
						  id:id, 
						  title:'添加建议', 
						  height:260, 
						  maxBtn:false,
						  page:'__PUBLIC__/html/content.html',
						  dgOnLoad:function(){
							$('#uid',dg.dgDoc).val(id);
						  }
						  });
    dg.ShowDialog();
}

function opdg2( id )
{
    //var dg = new J.dialog({ id:id, html:'lhgdialog' });
    //如果作为jQ组件来用的话J就得换成$
    var dg = new $.dialog({ 
						  id:id, 
						  title:'查看建议', 
						  height:260, 
						  maxBtn:false,
						  page:"__APP__/personal/ajaxComPage?uid="+id,
						  });
    dg.ShowDialog();
}

function addScore( id ){
	var fno = Number($('#scorePeople'+id).attr('value'));
	$('#peopleNo'+id).html("评分人数："+(fno+1));
	$.ajax({
			type:'POST',
			url:'__APP__/personal/addScore',
			data:{"uid":id,"score":$('#'+id).attr('value'),'year':$('#year').attr(),'season':$('#season').attr()},
			datatype:'html',
			beforeSend:function(){$('#resultScore'+id).html("<span style='color:red;'>正在提交...</span>")},
			success:function(data){
				$('#resultScore'+id).html("平均得分："+ data);
			},
			error:function(data){
				$('#resultScore'+id).html(data['error']);
			}
	});

}


</script> 
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="17" valign="top" background="__PUBLIC__/images/welcome/mail_leftbg.gif"><img src="__PUBLIC__/images/welcome/left-top-right.gif" width="17" height="29" /></td>
    <td valign="top" background="__PUBLIC__/images/welcome/content-bg.gif"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
        <tr>
          <td height="31"><div class="titlebt">员工评分</div></td>
        </tr>
      </table></td>
    <td width="16" valign="top" background="__PUBLIC__/images/welcome/mail_rightbg.gif"><img src= "__PUBLIC__/images/welcome/nav-right-bg.gif" width="16" height="29" /></td>
  </tr>
  <tr>
    <td valign="middle" background="__PUBLIC__/images/welcome/mail_leftbg.gif">&nbsp;</td>
    <td valign="top" bgcolor="#F7F8F9">
    <div id="welcomeContent"  style="height:565px;" >
    	<input type="hidden" id="year" value="{$year}" />
        <input type="hidden" id="season" value="{$season}" />
        <div class="right">
            <?php 
            $i = 0;
            foreach( $userInfo as $vo){?>      
           <div class="list">
                <img src="__PUBLIC__/images/people.jpg" width="100" height="100">
                <div class="store"><input class="xitong-input" align="absmiddle" name="scoreBox" id="{$vo['id']}" type="text" maxlength="1" value="8" />
                <input type="hidden" id="scorePeople{$vo['id']}" value="{$scoCount[$i]}" />
                <div class="but" style=""><a href="javascript:void(0)"  onclick="clsAddNum({$vo['id']},'-')"  ></a></div>
                <div class="but2" style=""><a href="javascript:void(0)"  onclick="clsAddNum({$vo['id']},'+')"  ></a></div>
                </div> 
                <ul>
                    <li>工号：{$vo['staffid']}</li>
                    <li>姓名：{$vo['staffName']}</li>
                    <li>部门：{$vo['department']}</li>
                    <li>职务：{$vo['position']}</li>
                    <input type="hidden" id="uid{$vo['id']}" value="{$vo['id']}" />
                    <li style=" width:95px;"><input type="image" id="addScore{$vo['id']}" onclick="addScore( {$vo['id']} )" class="tigger2" src="__PUBLIC__/images/button.jpg" /> </li>
                    <li style=" width:95px;"><input type="image" onclick="opdg( {$vo['id']} )" class="tigger" src="__PUBLIC__/images/button1.jpg" /> </li>
                    <li style=" width:95px;"><input type="image" onclick="opdg2( {$vo['id']} )" class="tigger" src="__PUBLIC__/images/detailCom.png" /> </li>
                    <li style="margin-top:15px;" id="resultScore{$vo['id']}">平均得分：{$scoreInfo[$i][0][0]}分</li>
                    <li style="width:95px; margin-top:15px;" id="peopleNo{$vo['id']}">评分人数：{$scoCount[$i]}人</li>
                    <li style="width:95px; margin-top:15px;">建议总数：{$comCount[$i]}条</li>
                </ul>
                <!-- <div class="comment">
                	<ul>
                    <?php 
                    $k = 0;
                    if(is_array($comInfo)&&($comInfo[$i]!=false)) foreach( $comInfo[$i] as $vo){      
                    ?>
                        <li>{$vo['comment']}</li>
                    <?php 
                    $k++;
                    }?>
               		</ul>
                </div>-->
               
           </div>
          <?php 
          $i++;
          }?>     
		  <center><div style="margin-top:10px; width:120px; height:20px;">{$page}</div></center>
     </div>
    
      </td>
    <td background="__PUBLIC__/images/welcome/mail_rightbg.gif">&nbsp;</td>
  </tr>
  <tr>
    <td valign="bottom" background="__PUBLIC__/images/welcome/mail_leftbg.gif"><img src="__PUBLIC__/images/welcome/buttom_left2.gif" width="17" height="17" /></td>
    <td background="__PUBLIC__/images/welcome/buttom_bgs.gif"><img src="__PUBLIC__/images/welcome/buttom_bgs.gif" width="17" height="17"></td>
    <td valign="bottom" background="__PUBLIC__/images/welcome/mail_rightbg.gif"><img src="__PUBLIC__/images/welcome/buttom_right2.gif" width="16" height="17" /></td>
  </tr>
</table>

{include file="public/footer"}